//
//  SEHospitalDetailSectionHeader.swift
//  SmartEyeForPatient
//
//  Created by qdsg on 2021/4/6.
//

import UIKit

class SEHospitalDetailSectionHeader: UIView {

    @IBOutlet var headerView: UIView!

    @IBOutlet weak var titleLabel: UILabel!

    var title: String {
        get {
            return titleLabel.text ?? ""
        }
        set {
            titleLabel.text = newValue
        }
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        loadNib()
    }

    required init?(coder: NSCoder) {
        super.init(coder: coder)
        loadNib()
    }

    func loadNib() {
        headerView = UINib.init(nibName: String(describing: type(of: self)), bundle: nil).instantiate(withOwner: self, options: nil).last as? UIView
        headerView.frame = bounds
        headerView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
        addSubview(headerView)
    }

}
